﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

using ZhimeiSoft.CharmManager.DOL;
using ZhimeiSoft.CharmManager.Server.Factory;
using ZhimeiSoft.CharmManager.Server.BLL.Interface;
using ZhimeiSoft.CharmManager.Server.DAL.Interface;


namespace ZhimeiSoft.CharmManager.Server.BLL
{
    public class CustomerBLL : ICustomerBLL
    {
        ICustomerDAL dal;
        public CustomerBLL()
        {
            dal = BaseDalFactory.CreateCustomerDal();
        }

        /// <summary>
        /// 新增客户信息
        /// </summary>
        /// <param name="customer">客户信息实体类</param>
        /// <returns>客户ID</returns>
        public void InsertCustomer(DBEntityCustomInfo customerInfo)
        {
            dal.InsertCustomer(customerInfo);
        }

        /// <summary>
        /// 更新客户信息
        /// </summary>
        /// <param name="customer">客户信息实体类</param>
        public void UpdateCustomer(DBEntityCustomInfo customerInfo)
        {
            dal.UpdateCustomer(customerInfo);
        }

        /// <summary>
        /// 删除客户信息
        /// </summary>
        /// <param name="customerID">客户ID</param>
        public void DeleteCustomer(int customerID)
        {
            dal.DeleteCustomer(customerID);
        }
        /// <summary>
        /// 根据用户状态获取信息
        /// </summary>
        /// <param name="sateStr">状态字符串</param>
        /// <returns>返回数据</returns>
        public System.Data.DataSet QueryCustomState(string stateStr)
        {
            return dal.QueryCustomState(stateStr);
        }
        /// <summary>
        /// 根据用户ID获取用户信息
        /// </summary>
        /// <param name="customerID">用户ID</param>
        /// <returns></returns>
        public DataSet QueryCustomID(int customerID)
        {
            return dal.QueryCustomID(customerID);
        }
        /// <summary>
        /// 根据会员姓名查询信息
        /// </summary>
        /// <param name="customName"></param>
        /// <returns></returns>
        public DataSet QueryCustomName(string customName)
        {
            return dal.QueryCustomName(customName);
        }

   }
}
